//
//  CJBannerAd.h
//  CJMobileAd
//
//  Created by JJ on 2022/2/26.
//  Copyright © 2022 JJ. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN
@class CJBannerAd;
@protocol CJBannerAdDelegate <NSObject>

- (void)bannerAdDidLoad:(UIView *)bannerView resourceId:(NSString *)resourceId;

- (void)bannerAdLoadFailed:(id)bannerAd error:(NSError *)error;

- (void)bannerAdOnClicked:(id)bannerAd;

- (void)bannerAdOnClosed:(id)bannerAd;

@end

@interface CJBannerAd : NSObject

@property (nonatomic,weak) id <CJBannerAdDelegate> delegate;

- (instancetype)initWithResourceId:(NSString *)resourceId
            rootViewController:(UIViewController *)rootViewController
                          rect:(CGRect)rect;

/// 加载
- (void)loadAdData;

- (void)loadAdDataAndShow:(UIView *)containView;

@end

NS_ASSUME_NONNULL_END
